package com.mapper;

import com.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author aiou
 * @since 2025-06-12
 */
@Mapper
public interface RoleMapper{

    //添加角色信息
    @Insert("insert into role(role_name) values(#{roleName})")
    boolean insert(Role role);
    //修改角色信息
    @Update("update role set role_name = #{roleName} where role_id = #{roleId}")
    boolean updateById(Role role);

    //删除角色信息
    @Delete("delete from role where role_id = #{roleId}")
    boolean deleteByRoleId(Integer roleId);

    @Select("select * from role")
    List<Role> list();
}
